package com.cedarhd.finance.msg.domain.repository;

import com.cedarhd.finance.msg.common.enums.PointType;
import com.cedarhd.finance.msg.domain.entity.Point;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;


/**
 * @author Evan
 * @date 2018/3/26
 */
@Repository
public interface PointRepository extends JpaRepository<Point,Integer> {
    /**
     * 根据手机号，埋点类型，记录日期查询数据
     * @param userPhone 手机号
     * @param pointType 埋点类型
     * @param recordDate 记录日期
     * @return
     */
    Point findByUserPhoneAndPointTypeAndRecordDate(String userPhone, PointType pointType,String recordDate);

    /**
     * 根据条件分页查询数据
     * @param spec
     * @param page
     * @return
     */
    Page<Point> findAll(Specification<Point> spec, Pageable page);
}
